<ui:composition template="/WEB-INF/templates/defaultLayout.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

	<ui:define name="title">
		#{lang.getTrans("ui.mobile.contact.title")}
	</ui:define>
	<ui:define name="layoutCenter">
		<h:form>
			<p:growl id="growl"/>
			<p:breadCrumb>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.home')}" url="/home.xhtml"/>
				<p:menuitem value="#{lang.getTrans('ui.mobile.common.bread.contact')}" url="/crud/contact/contactForm.xhtml"/>
			</p:breadCrumb>
			<p:panel id="panel" header="#{lang.getTrans('ui.mobile.contact.cadastre')}">
				<h:panelGrid columns="2">
				
					<h:outputLabel value="#{lang.getTrans('ui.mobile.contact.name')}" for="cdContact" />
					<p:inputText id="cdContact" value="#{contactBean.contact.cdContact}"
						required="true" size="50" maxlength="60"
						requiredMessage="#{lang.getTrans('ui.mobile.contact.name.obrigatorio')}" />
					
					<h:outputLabel value="#{lang.getTrans('ui.mobile.contact.email')}" for="cdEmail" />
					<p:inputText id="cdEmail" value="#{contactBean.contact.cdEmail}"
						required="true" size="50" maxlength="80"
						requiredMessage="#{lang.getTrans('ui.mobile.contact.email.obrigatorio')}" />
					
					<h:outputLabel value="#{lang.getTrans('ui.mobile.contact.descricao')}" for="dsContact" />
					<p:editor id="dsContact" width="600" value="#{contactBean.contact.dsContact}"
						required="true" 
						requiredMessage="#{lang.getTrans('ui.mobile.contact.descricao.obrigatorio')}"/>
					
				</h:panelGrid>
			</p:panel>
			<p:blockUI block="panel" trigger="btSub"/>
			<p:panel style="text-align:center">
				<h:inputHidden id="idServiceSituation" value="#{contactBean.contact.idContact}" />
				<h:inputHidden id="nrVersion" value="#{contactBean.contact.nrVersion}" />
				<p:commandButton id="btSub" value="#{lang.getTrans('ui.mobile.common.save')}"
					type="submit" action="#{contactBean.adicionar}" />
				<p:button value="#{lang.getTrans('ui.mobile.common.cancel')}" outcome="home" />
			</p:panel>
			<h:outputLabel value="#{lang.getTrans('ui.mobile.contact.information')}" />
		</h:form>
	</ui:define>
</ui:composition>
